#ifndef __APP_TIMER_H__
#define __APP_TIMER_H__

#define MAX_TIMER_HANDLER   (8) /**<MAX_TIMER_HANDLER   (8)*/

typedef void (*AppTimer_Handler)(void); /**< App Timer Handler*/

typedef enum _APPLIB_TIMER_ID_e_ {
    TIMER_1HZ,
    TIMER_2HZ,
    TIMER_4HZ,
    TIMER_10HZ,
    TIMER_20HZ,
    TIMER_5S,
    TIMER_10s,
    TIMER_30S,
    TIMER_NUM
} APPLIB_TIMER_ID_e;

typedef struct _APPLIB_TIMER_s_ {
    UINT32 Valid;  /* 1:Valid timer, 0:free entry */
    int HandlerNum;
    int iTime;      /* time cycle */
    AppTimer_Handler Handler[MAX_TIMER_HANDLER];
} APPLIB_TIMER_s;

extern ULONG AppLibTimer_Init(void);
extern ULONG AppLibTimer_UnregisterAll(void);
extern ULONG AppLibTimer_Register(INT32 tid, AppTimer_Handler handler);
extern ULONG AppLibTimer_Unregister(INT32 tid, AppTimer_Handler handler);

#endif

